<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<?php $this->load->helper('HTML');
echo link_tag('css/style2.css');
echo link_tag('images/favicon.ico','shortcut icon','image/x-icon');
?>
</head>
<?php

header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=sales.xls");
header("Pragma: no-cache");
header("Expires: 0");

?>
<body>
<table width="1500" align="center">
<tr>
   	  <td width="1309" align="center">
        <table width="1500" align="center">
        <tr>
          <td width="440" rowspan="4" valign="top"><img src="<?php echo base_url();?>images/logo.jpg" />&nbsp;</td>
          <td width="203">&nbsp;</td>
     	  <td width="41">&nbsp;</td>
        </tr>
        
        
        <tr>
            <td >&nbsp;</td>
            <td>&nbsp;</td>
        </tr>
        <tr align="center">
            
        </tr>
        <tr align="center">
         
        </tr>
        <tr align="center" class="judul">
          <td colspan="2">LAPORAN ALL OMSET</td>
          <td>&nbsp;</td>
        </tr>
        <tr align="center" class="detail">
          <td colspan="2">WEEK ( <?php echo $intid_week; ?> )</td>
          <td>&nbsp;</td>
        </tr>
    </table>    </td>
  <tr>
    	<td align="center">
       	  <table width="1500" border="1" align="center"  class="detail">
			<tr class="detail2"> 
			  <th width="190">NO</th>
              <th>NAMA CABANG</th>
              <th>TOTAL OMSET</th>
              <th colspan="8">OMSET</th>
              <th>TOTAL</th>
              <th>PV</th>
			</tr>
                
                <tr class="detail2">
                  <td align="left">&nbsp;</td>
                  <td align="center">&nbsp;</td>
                  <td width="150" align="center">&nbsp;</td>
                  <td width="150" align="center"><strong>OMSET10</strong></td>
                  <td width="120" align="center"><strong>OMSET20</strong></td>
                  <td width="150" align="center"><strong>NETTO</strong></td>
                  <td width="120" align="center"><strong>SPECIAL PRICE</strong></td>
				  <td width="150" align="center"><strong>POINT</strong></td>
                  <td width="120" align="center"><strong>SK</strong></td>
                  <td width="150" align="center"><strong>LG</strong></td>
                  <td width="120" align="center"><strong>LL</strong></td>
                  <td width="120" align="center">&nbsp;</td>
                  <td width="70" align="center">&nbsp;</td>
              </tr>
               <tr>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                  <td align="left">&nbsp;</td>
                  <td align="left">&nbsp;</td>
				  <td align="left">&nbsp;</td>
                  <td align="left">&nbsp;</td>
                  <td align="left">&nbsp;</td>
                  <td align="left">&nbsp;</td>
                  <td align="left">&nbsp;</td>
                  <td align="left">&nbsp;</td>
                  <td align="left">&nbsp;</td>
                  <td align="left">&nbsp;</td>
                  <td align="left">&nbsp;</td>
               </tr>
                <?php
				$i = 1;
				$totalpv =0;
				$totalnett = 0;
                foreach($default as  $d):
                ?>
				<tr class="detail">
                    <td align="justify"><?php echo $i++; ?></td>
                    <td align="justify"><?php echo $d->strnama_cabang;?></td>
                    <td align="justify"><?php if (!empty($d->inttotal_omset)) {echo $d->inttotal_omset;} else {echo 0;}?></td>
                    <td align="justify"><?php if (!empty($d->intomset10)) {echo $d->intomset10;} else {echo 0;}?></td>
                    <td align="justify"><?php if (!empty($d->intomset20)) {echo $d->intomset20;} else {echo $d->intomset20;}?></td>
					<td align="justify"><?php if (!empty($d->omsetnetto)) {echo $d->omsetnetto;} else {echo 0;}?></td>
                    <td align="justify"><?php if (!empty($d->omsetspecialprice)) {echo $d->omsetspecialprice;} else {echo 0;}?></td>
					<td align="justify"><?php if (!empty($d->omsetpoint)) {echo $d->omsetpoint;} else {echo 0;}?></td>
                    <td align="justify"><?php if (!empty($d->omsetsk)) {echo $d->omsetsk;} else {echo 0;}?></td>
                    <td align="justify"><?php if (!empty($d->omsetlg)) {echo $d->omsetlg;} else {echo 0;}?></td>
                    <td align="justify"><?php if (!empty($d->omsetll)) {echo $d->omsetll;} else {echo 0;}?></td>
					<td><?php echo $d->inttotal_bayar;?></td>
                    <td><?php echo $d->intpv;?></td>
				</tr>
                <?php
				$totalnett= $totalnett + $d->inttotal_bayar;
				$totalpv=$totalpv + $d->intpv; 
				endforeach;?>
                <tr>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                  <td align="left">&nbsp;</td>
	              <td align="left">&nbsp;</td>
                  <td align="left">&nbsp;</td>
                  <td align="left">&nbsp;</td>
                  <td align="left">&nbsp;</td>
                  <td align="left">&nbsp;</td>
                  <td align="left">&nbsp;</td>
                  <td align="left">&nbsp;</td>
                  <td align="left">&nbsp;</td>
                  <td align="left">&nbsp;</td>
                </tr>
    </table>    
                <tr>
                  <td align="right" colspan='10'>Jumlah PV ALL CABANG</td>
                  <td align="left">:</td>
                  <td align="left"><?php echo $totalpv;?></td>
                </tr>
				<tr>
                  <td align="right" colspan='10'>Jumlah NETT ALL CABANG</td>
                  <td align="left">:</td>
                  <td align="left"><?php echo $totalnett;?></td>
                </tr>
    </table>      </td>
    </tr>
</table>
</body>
</html>